package com.example.springbootsfzy.service.gengminghui;

import com.example.springbootsfzy.domain.CourseQuestions;
import com.example.springbootsfzy.mapper.CourseQuestionsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseQuestionsService {
    @Autowired
    private CourseQuestionsMapper courseQuestionsMapper;

    //查询所有问题和咨询师昵称
    public List<CourseQuestions> selectAll(){
        return courseQuestionsMapper.selectAll();
    }
    //添加问题
    public int insert(CourseQuestions record){
        return courseQuestionsMapper.insert(record);
    }
    //根据id删除问题
    public int deleteByPrimaryKey(Integer id){
        return courseQuestionsMapper.deleteByPrimaryKey(id);
    }
    //根据id修改问题
    public int updateByPrimaryKeySelective(CourseQuestions record){
        return courseQuestionsMapper.updateByPrimaryKeySelective(record);
    }

    //根据id查询问题
    public List<CourseQuestions> selectByCourseId(Integer id){
        return courseQuestionsMapper.selectByCourseId(id);
    }

    //根据咨询师id查询问题
    public List<CourseQuestions> selectByConsultantId(Integer id){
        return courseQuestionsMapper.selectByConsultantId(id);
    }


}
